import React, { Component } from 'react'
import {connect} from "react-redux"
import {bindActionCreators} from "redux"
import * as action from "../action/index.js"
 class Dirlog extends Component {
    //  state = {
    //      show:false
    //  }
   // 点击确定调仓库得方法
   surefn(){
    this.props.delFN(this.props.delndex)
    let wrap = document.getElementById("wrap")
    wrap.style.display = "none"
   }
    // 点击取消得事件
    cancal() {
        // let wrap = document.getElementById("wrap")
        // wrap.style.display = "none"
        this.props.zichuanfu(false)
    }
  render() {
      console.log(this.props)
      let {isShow} = this.props  // 默认传过来得是false
    return (
     <div>
         {
            isShow ?<div className='Dirlogwrap' id='wrap'>
             <h3>删除弹框</h3>
             <p>你确定要删除吗?</p>
             <p><button onClick={this.cancal.bind(this)}>取消</button><button onClick={this.surefn.bind(this)}>确定</button></p>
        </div>:""
         }
           
     </div>
    
    )
  }
}
let mapStateToprops = (state)=>{
    console.log(state)
      return {
          ...state.antdReducer
      }
}
let mapDispatchToprops =(disptach)=>bindActionCreators(action,disptach)
export default connect(mapStateToprops,mapDispatchToprops)(Dirlog)